{% extends "_layout.html" %}
{% import "component/forms.njk" as forms %}

{# 样式代码 #}
{% block style %}
<link href="/css/plugins/iCheck/custom.css" rel="stylesheet">
{% endblock %}

{# bodyd代码#}
{% block body %}
<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>添加菜品</h5>
                </div>
                <div class="ibox-content">
                    <form class="form-horizontal m-t from" id="form" action="/product/recommend" method="post" data-href="/product">
                    	{{ forms.hidden('id', data.id) }}
						{{ forms.text('推荐名称', 'recommendName', data.recommendName, '请输入推荐名称', 'required') }}


                        {{ forms.images(
						    label = '菜品推荐图',
						    fileList = [{
						            name: 'recommendImage',
						            value: data.recommendImage,
						            url: ctx.helper.showImage(data.recommendImage, 160, 160, 'fixed'),
						            text: ''
						        }]
						)}}

                        {{ forms.submit() }}
                    </form>
                </div>
            </div>
        </div>

    </div>
{% endblock %}

{#js代码#}
{% block js %}
<script>
    $(function () {
        var e = "";
        $("#form").validate({
            rules: {
            },
            messages: {
            },
            submitHandler: function() {
              asyncSubmitForm($("#form"));
            }
        });

    });
</script>

{% endblock %}